<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCnDiagnosesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('st_cn_diagnoses', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('record_id')->comment('病历ID');
//            $table->unsignedInteger('diagnose_id')->comment('诊断ID');
            $table->unsignedInteger('cn_disease_id')->comment('中医病名ID');
            $table->unsignedMediumInteger('type_id')->default(0)->comment('诊断分型ID');
            $table->string('carry_key')->default('')->comment('挟');
            $table->timestamps();

            $table->index('record_id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('st_cn_diagnoses');
    }
}
